import request from '@/utils/request'
// 1.设备管理-表格数据
export const VmSearch = (params) => {
  return request({
    url: '/vm-service/vm/search',
    params
  })
}
// 2.设备管理--批量策略管理下拉数据
export const VmSearchPolicy = () => {
  return request({
    url: '/vm-service/policy'
  })
}
// 3.设备管理修改pl策略管理--确定
export const updataApplyPolicy = (data) => {
  return request({
    url: '/vm-service/vm/applyPolicy',
    method: 'put',
    data
  })
}
// 4.设备管理-新增设备-确定
export const updataEquip = (data) => {
  return request({
    url: '/vm-service/vm',
    method: 'post',
    data
  })
}

// 5.设备管理-新增设备-选择型号
export const typeEquip = (params) => {
  return request({
    url: '/vm-service/vmType/search',
    params
  })
}
// 5.设备管理-新增设备-选择点位
export const nodeEquip = (params) => {
  return request({
    url: '/vm-service/node/search',
    params
  })
}
// 6.设备管理-修改设备
export const updatanodeEquip = (id, nodeId) => {
  return request({
    url: `/vm-service/vm/${id}/${nodeId}`,
    method: 'put'
  })
}
// 7.设备管理设备状态--销售量个数--销售额
export const orderCount = (params) => {
  return request({
    url: '/order-service/report/orderCount',
    params
  })
}
// 销售额
export const orderAmount = (params) => {
  return request({
    url: '/order-service/report/orderAmount',
    params
  })
}
// 补货次数
export const supplyCount = (params) => {
  return request({
    url: `/task-service/task/supplyCount/${params.innerCode}/${params.start}/${params.end}`
  })
}
// 维修次数
// /task-service/task/repairCount
export const repairCount = (params) => {
  return request({
    url: `/task-service/task/repairCount/${params.innerCode}/${params.start}/${params.end}`
  })
}
// 商品销量
export const skuCollect = (params) => {
  return request({
    url: `/order-service/report/skuCollect/${params.innerCode}/${params.start}/${params.end}`
  })
}

// 8.设备管理-设备类型管理
export const vmTypeList = (params) => {
  return request({
    url: '/vm-service/vmType/search',
    params
  })
}

// 9.新增设备类型
export const addvmType = (data) => {
  return request({
    url: '/vm-service/vmType',
    method: 'post',
    data
  })
}
// 10.修改设备类型
export const updatavmType = (data) => {
  return request({
    url: `vm-service/vmType/${data.typeId}`,
    method: 'put',
    data
  })
}
